package com.wicket.okrapp.biz.service.nb;

import cn.hutool.core.bean.BeanUtil;
import com.wicket.okrapp.common.baseinfo.BaseInfoDO;
import com.wicket.okrapp.common.baseinfo.BaseInfoHolder;
import com.wicket.okrapp.common.util.CommonFunctionHelper;
import org.apache.skywalking.apm.toolkit.trace.Tag;
import org.apache.skywalking.apm.toolkit.trace.Tags;
import org.apache.skywalking.apm.toolkit.trace.Trace;
import org.springframework.stereotype.Service;
import com.wicket.okrapp.biz.service.dto.req.ImplementBizPublicFieldPushMemoryReqDto;
import com.wicket.okrapp.biz.service.dto.res.ImplementBizPublicFieldPushMemoryRespDto;
import com.wicket.okrapp.biz.service.dto.req.ImplementAccessParameterBizFieldReqDto;
import com.wicket.okrapp.biz.service.dto.res.ImplementAccessParameterBizFieldRespDto;

/**
 * @author ： 手工接入方法
 * @since 2022/5/28 15:32
 *
 *
 * @version 1.0
 */
@Service
public class NbContTagRcord {
/**
      * code:publicFieldCache
      * name:M3执行业务应用公共字段推送内存（特殊方法）
      * desc:undefined
      * gen by moon at 2/20/2023, 12:29:24 PM
      * 
      **/
     @Trace(operationName = "M3执行业务应用公共字段推送内存（特殊方法）")
     @Tags({@Tag(key = "参数",value = "arg[0]"),
     @Tag(key = "返回值",value = "returnedObj")})
      public ImplementBizPublicFieldPushMemoryRespDto implementBizPublicFieldPushMemory(ImplementBizPublicFieldPushMemoryReqDto reqDto) {
         BaseInfoDO domain = new BaseInfoDO();
         if(BaseInfoHolder.contextHolder.get()!=null){
             BeanUtil.copyProperties(BaseInfoHolder.contextHolder.get().getBaseInfo(),domain);
             BaseInfoHolder.contextHolder.remove();
         }
         if(reqDto.getSpaceId()!=null){
             domain.setSpecSpaceId(reqDto.getSpaceId());
         }

         if(reqDto.getCreateInductionId()!=null){
             domain.setSpecInductionRecordId(reqDto.getCreateInductionId());
         }

         if(reqDto.getAppId()!=null){
             domain.setSpecAppId(reqDto.getAppId());
         }

         if(reqDto.getHighestOrgID()!=null){
             domain.setSpecHighestOrgID(reqDto.getHighestOrgID());
         }

         if(reqDto.getUserId()!=null){
             domain.setSpecUserId(reqDto.getUserId());
         }

         if(reqDto.getOriginalRoleMemberId()!=null){
             domain.setSpecOriginalRoleMemberId(reqDto.getOriginalRoleMemberId());
         }

         CommonFunctionHelper.setBaseInfoToLocal(domain);
         return new ImplementBizPublicFieldPushMemoryRespDto();
      }
/**
      * code:receptionService
      * name:M3执行获取出入参业务字段（特殊方法）
      * desc:undefined
      * gen by moon at 2/20/2023, 12:29:41 PM
      * 
      **/
     @Trace(operationName = "M3执行获取出入参业务字段（特殊方法）")
     @Tags({@Tag(key = "参数",value = "arg[0]"),
     @Tag(key = "返回值",value = "returnedObj")})
      public ImplementAccessParameterBizFieldRespDto implementAccessParameterBizField(ImplementAccessParameterBizFieldReqDto reqDto) {
       // TODO ruizhe skai dong ; 2/20/2023, 12:29:41 PM
        return new ImplementAccessParameterBizFieldRespDto();
      }
  //手工接入方法
}
